/*************************************************
 * 
 * Copyright by Bruno Eberhard
 * 
 * Created on 29.07.2005
 *
 *************************************************/
package fightplan.business;

import fightplan.core.Util;

public class Team extends AbstractFighter {
	private static final long serialVersionUID = 1L;

	private Category category;
	private Integer number; // (in Kategorie)

	public Team() {
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	public boolean compatible(AbstractFighter fighter) {
		return Util.equals(getDojo(), fighter.getDojo());
	}

	@Override
	public String getCategoryNames(Tournament tournament) {
		return category.getNameOrDescription();
	}

	@Override
	public String getDisplayName() {
		return getName();
	}

	@Override
	public String getName() {
		if (number != null) {
			return getDojo().getName() + " " + number;
		} else {
			return getDojo().getName();
		}
	}

}
